Type.h
Language: C++
Last Modified: 2022-10-11 1:10:08 AM UTC
File Size: 1531 bytes
Last Modified: 2022-10-11 1:10:08 AM UTC
File Size: 1531 bytes
http://www.penguinstew.ca/example/CodeFormater/Type.h
#pragma once
#include <String>
#include <vector>
#include "lang.h"
#include "State.h"
#include "Set.h"
class Type
{
std::string ext;
std::string name;
bool highlightNumbers;
std::string escapeChar;
std::vector<std::string> prefixHex;
std::vector<std::string> postfixHex;
std::vector<std::string> prefixOctal;
std::vector<std::string> postfixOctal;
std::vector<std::string> prefixBinary;
std::vector<std::string> postfixBinary;
std::vector<Lang> langs;
std::vector<State> states;
std::vector<Set> sets;
public:
Type();
Type(std::string type);
std::string GetExt();
std::string GetName();
bool IsHighLightNumbers();
std::string GetEscapeChar();
std::vector<Lang> GetLangs();
std::vector<State> GetStates();
Lang* FindBaseType();
State* FindStarState(std::string line, int pos, TypeIdPair typeId);
std::vector<Set> GetSets();
int FindAndPrintSetWord(std::stringstream& lineStream, std::string line, int pos, TypeIdPair typeId, char preC, State currentState);
int FindAndPrintNumber(std::stringstream& lineStream, std::string line, int pos);
std::string ToString();
private:
std::string TryGetNumber(std::string line, int pos);
std::string TryGetPrefixNumber(std::string line, int pos, std::vector<std::string> prefixes, std::regex numberRegEx);
std::string TryGetPostfixNumber(std::string line, int pos, std::vector<std::string> postFixes, std::regex numberRegEx);
std::string GetNumberFromLineIfNextCharValid(std::string line, int pos, int length);
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46